import config from '../config/config'

const request = config.request;
const API = {

  //wx相关

  //微信登录
  wechatLogin(params) {
    return request({
      url: '/wechat/login',
      params: params,
      method: 'get'
    })
  },

  //financial财务相关

  //提现
  getCash(params) {
    return request({
      url: '/financial/getCash',
      params: params
    })
  },

  //充值
  recharge(params) {
    return request({
      url: '/financial/recharge',
      params: params
    })
  },

  //牛人集市
  getAllAwesome(params) {
    return request({
      url: '/financial/getAllAwesome',
      params: params
    })
  },

  //获取我的所有订阅
  getAllMySubscribe() {
    return request({
      url: '/financial/getAllMySubscribe'
    })
  },

  //获取所有我的持仓
  getAllMyPositions() {
    return request({
      url: '/financial/getAllMyPositions'
    })
  },
  //获取别人的操作
  getOtherOperation(params) {
    return request({
      url: '/financial/getOtherOperation',
      params: params
    })
  },

  //获取我的操作
  getMyOperation() {
    return request({
      url: '/financial/getMyOperation'
    })
  },

  //获取持仓详情
  getPositionInfo(params) {
    return request({
      url: '/financial/getPositionInfo',
      params: params
    })
  },

  //获取持仓详情
  getProductInfo(params) {
    return request({
      url: '/financial/getProductInfo',
      params: params
    })
  },

  //搜索产品
  searchProductName(params) {
    return request({
      url: '/financial/searchProductName',
      params: params
    })
  },

  //搜索产品
  getDefaultProduct() {
    return request({
      url: '/financial/getDefaultProduct'
    })
  },

  //添加持仓
  addPosition(params) {
    return request({
      url: '/financial/addPosition',
      params: params
    })
  },

  //增持
  increasePosition(params) {
    return request({
      url: '/financial/increasePosition',
      params: params
    })
  },

  //减持
  declinePosition(params) {
    return request({
      url: '/financial/declinePosition',
      params: params
    })
  },

  //user
  //用户登录
  login(params) {
    return request({
      url: '/user/login',
      method: 'get',
      params: params
    })
  },

  //发送验证码
  sendMessage(params) {
    return request({
      url: '/user/sendMessage',
      method: 'get',
      params: params
    })
  },

  //获取用户
  getUser() {
    return request({
      url: '/user/getUser',
      method: 'get'
    })
  },
  //获取用户
  getUserAndProfit() {
    return request({
      url: '/user/getUserAndProfit',
      method: 'get'
    })
  },
  //查看他人
  getOtherUser(params) {
    return request({
      url: '/user/getOtherUser',
      method: 'get',
      params: params
    })
  },

  //订阅
  cancelSubscribe(params) {
    return request({
      url: '/user/cancelSubscribe',
      params: params
    })
  },
  //取消订阅
  subscribe(params) {
    return request({
      url: '/user/subscribe',
      params: params
    })
  },
  //获取还贷计划列表
  qryLoanPlans(params) {
    return request({
      url: '/loan/qryLoanPlans',
      params: params
    })
  },

  //添加还贷计划
  addLoanPlan(params) {
    return request({
      url: '/loan/addLoanPlan',
      params: params
    })
  },

  //计算还贷计划
  calLoanPlan(params) {
    return request({
      url: '/loan/calLoanPlan',
      params: params
    })
  },

  //获取还贷计划
  getLoanPlan(params) {
    return request({
      url: '/loan/getLoanPlan',
      params: params
    })
  },
};

export default API;
